import request from '@/utils/http'

// export function addAuthority (payload) {
//   return request({
//     url: 'authority',
//     method: 'post',
//     data: payload
//   })
// }
export function addAuthority (payload) {
  return request({
    url: 'role/insert',
    method: 'post',
    data: payload
  })
}

// export function delAuthority (_id) {
//   return request({
//     url: 'authority/' + _id,
//     method: 'delete'
//   })
// }
export function delAuthority (payload) {
  return request({
    url: 'role/delete',
    method: 'delete',
    data: payload
  })
}

// export function updateAuthority (_id, payload) {
//   return request({
//     url: 'authority/' + _id,
//     method: 'put',
//     data: payload
//   })
// }
export function updateAuthority (_id, payload) {
  return request({
    url: 'role/update',
    method: 'put',
    data: payload
  })
}
export function searchAuthority (_id) {
  return request({
    url: 'authority/' + _id,
    method: 'get'
  })
}
// export function showAuthority (payload) {
//   return request({
//     url: 'authority',
//     method: 'get',
//     params: payload
//   })
// }
export function showAuthority (payload) {
  return request({
    url: 'role/findByN',
    method: 'get',
    params: payload
  })
}
export function findDevAuthority (params) {
  return request({
    url: 'authority/findDevAuthority',
    method: 'get',
    params: params
  })
}
export function findRoleApi (params) {
  return request({
    url: 'role/findApi',
    method: 'get',
    params: params
  })
}
export function getAllAuth () {
  return request({
    url: 'authority/getAllAuth',
    method: 'get'
  })
}
